<template>
<div>
  <homeheader></homeheader>
  <HomeSwiper :swiperList="swiperList"></HomeSwiper>
  <Icons :List="iconsList"></Icons>
  <recommend :recommendList="recommendList"></recommend>
  <weekend :weekendList="weekendList"></weekend>

</div>
</template>

<script>
import homeheader from './components/header'
import HomeSwiper from './components/Swiper'
import Icons from './components/icons'
import recommend from './components/recommend'
import weekend from './components/weekend'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    homeheader,
    HomeSwiper,
    Icons,
    recommend,
    weekend
  },
  data () {
    return {
      iconsList: [],
      swiperList: [],
      recommendList: [],
      weekendList: []

    }
  },
  methods: {
    getHomeInfo () {
      axios.get('/api/index.json')
        .then(this.getHomeInfoSucc)
    },
    getHomeInfoSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.iconsList = data.iconList
        this.swiperList = data.swiperList
        this.recommendList = data.recommendList
        this.weekendList = data.weekendList
      }
    }
  },
  mounted () {
    this.getHomeInfo()
  }
}
</script>

<style>
</style>
